package com.gsnd.gsnd22estore.domain;

import java.io.Serializable;
import lombok.Data;

/**
 * 收货地址表
 * @TableName es_address
 */
@Data
public class EsAddress implements Serializable {
    /**
     * 收货地址ID
     */
    private Integer id;

    /**
     * 收件人姓名
     */
    private String receiverName;

    /**
     * 省市区地址
     */
    private String urbanAddr;

    /**
     * 详细地址
     */
    private String detailAddr;

    /**
     * 收件人电话
     */
    private String phone;

    /**
     * 下单客户ID
     */
    private Integer userId;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EsAddress other = (EsAddress) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getReceiverName() == null ? other.getReceiverName() == null : this.getReceiverName().equals(other.getReceiverName()))
            && (this.getUrbanAddr() == null ? other.getUrbanAddr() == null : this.getUrbanAddr().equals(other.getUrbanAddr()))
            && (this.getDetailAddr() == null ? other.getDetailAddr() == null : this.getDetailAddr().equals(other.getDetailAddr()))
            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getReceiverName() == null) ? 0 : getReceiverName().hashCode());
        result = prime * result + ((getUrbanAddr() == null) ? 0 : getUrbanAddr().hashCode());
        result = prime * result + ((getDetailAddr() == null) ? 0 : getDetailAddr().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", receiverName=").append(receiverName);
        sb.append(", urbanAddr=").append(urbanAddr);
        sb.append(", detailAddr=").append(detailAddr);
        sb.append(", phone=").append(phone);
        sb.append(", userId=").append(userId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}